package com.fzg.controller;

import com.fzg.common.enums.ResponseWrapper;
import com.fzg.common.model.recruitmentInfoManage.param.*;
import com.fzg.service.RecruitmentInforService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 招聘信息表 前端控制器
 * </p>
 *
 * @author fzg
 * @since 2021-12-13
 */
@RestController
@RequestMapping("/recruitment-infor")
public class RecruitmentInforController {

    @Autowired
    private RecruitmentInforService recruitmentInforService;

    /**
     * 获取招聘信息列表
     */
    @GetMapping("/getRecruitmentInfoList")
    public ResponseWrapper getRecruitmentInfoList(@Validated GetResruitListParam param){
        return recruitmentInforService.getRecruitmentInfoList(param);
    }

    /**
     * 获取企业下拉列表
     */
    @GetMapping("/getEnterpriseList")
    public ResponseWrapper getEnterpriseList(@Validated GetCompanyListParam param){
        return recruitmentInforService.getEnterpriseList(param);
    }

    /**
     * 修改或添加招聘信息
     */
    @PostMapping("/editOrAddRecruitInfo")
    public ResponseWrapper editOrAddRecruitInfo(@Validated @RequestBody EditOrAddRecruitInfoParam param){
        return recruitmentInforService.editOrAddRecruitInfo(param);
    }

    /**
     * 删除招聘信息
     */
    @PostMapping("/delRecruInfo")
    public ResponseWrapper delRecruInfo(@Validated @RequestBody DelRecruitInfoParam param){
        return recruitmentInforService.delRecruInfo(param);
    }

    /**
     * 获取公司所有招聘信息
     */
    @GetMapping("/getCompanyRecruitInfoList")
    public ResponseWrapper getCompanyRecruitInfoList(@Validated GetCompanyRecruitInfoListParam param){
        return recruitmentInforService.getCompanyRecruitInfoList(param);
    }

    /**
     * 获取招聘详情的所有信息
     */
    @GetMapping("/getPositionAllInfo")
    public ResponseWrapper getPositionAllInfo(@Validated GetPositionAllInfoParam param){
        return recruitmentInforService.getPositionAllInfo(param);
    }

    /**
     * 得到全部公司的招聘信息列表
     */
    @GetMapping("/getAllcompanyRecruitList")
    public ResponseWrapper getAllcompanyRecruitList(GetAllcompanyRecruitListParam param){
        return recruitmentInforService.getAllcompanyRecruitList(param);
    }

}
